﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Engine.SceneControl.Object;
using Microsoft.Xna.Framework.Input;
using Engine.Input;
using Engine.Material;
using Engine.Physic;
using Engine.Modelo;
using Engine.Behavior;

namespace Etapa1.BindKey
{
    public class BindObjectSample : SimpleObject
    {
        public BindObjectSample(IMaterial material, IPhysicObject physicObject, IModelo modelo, IBehaviors behavior)
            : base(material, physicObject, modelo)
        { }

        public void mousebuttonteste(MouseState ms)
        {
        }
        public void mousebuttonteste2(MouseState ms)
        {
        }

        public void BindMouseExample(MouseButtons mb)
        {
            InputPlaybleMouseBottom ip1 = new SimpleConcreteMouseBottomInputPlayable(StateKey.PRESS,EntityType.IOBJECT,mb,mousebuttonteste);
            InputPlaybleMousePosition ip2 = new SimpleConcreteMousePositionInputPlayable(EntityType.IOBJECT,mousebuttonteste2);

            BindMouseCommand bkc1 = new BindMouseCommand(ip1, BindAction.ADD);
            BindMouseCommand bkc2 = new BindMouseCommand(ip2, BindAction.ADD);

            this.CommandProcessor.SendCommandSyncronous(bkc1, InputAdvanced.MyName);
            this.CommandProcessor.SendCommandSyncronous(bkc2, InputAdvanced.MyName);

        }

        public void BindKeyExample(Keys tecla1, Keys tecla2)
        {
            InputPlayableKeyBoard ip1 = new SimpleConcreteKeyboardInputPlayable(StateKey.PRESS, tecla1, QUANDO_TECLA_1_FOR_APERTADA, EntityType.IOBJECT);
            InputPlayableKeyBoard ip2 = new SimpleConcreteKeyboardInputPlayable(StateKey.PRESS, tecla2, QUANDO_TECLA_2_FOR_APERTADA, EntityType.IOBJECT);

            BindKeyCommand bkc1 = new BindKeyCommand(ip1,BindAction.ADD);
            BindKeyCommand bkc2 = new BindKeyCommand(ip2, BindAction.ADD);

            this.CommandProcessor.SendCommandSyncronous(bkc1, InputAdvanced.MyName);
            this.CommandProcessor.SendCommandSyncronous(bkc2, InputAdvanced.MyName);


        }

        public void QUANDO_TECLA_1_FOR_APERTADA(InputPlayableKeyBoard ip2)
        {
        }
        public void QUANDO_TECLA_2_FOR_APERTADA(InputPlayableKeyBoard ip2)
        {
        }
    }
}
